import http from './../../../base/api/public'
import querystring from 'querystring'
let sysConfig = require('@/../config/sysConfig')
let apiUrl = sysConfig.xcApiUrlPre;

export default {
  //页面分页查询接口
  page_list(page,size,params) {
    //http.requestQuickGet("http://localhost:31001/cms/page/list/"+page+"/"+size)
    let string = querystring.stringify(params)
    return http.requestGet(apiUrl+"/cms/page/list/"+page+"/"+size+"?"+string);
  },
  //站点查询
  site_list() {
    return http.requestQuickGet(apiUrl+"/cms/site/list");
  },
  //模板查询
  template_list() {
    return http.requestQuickGet(apiUrl+"/cms/template/list");
  },
  template_page(page,size,params) {
    //http.requestQuickGet("http://localhost:31001/cms/page/list/"+page+"/"+size)
    let string = querystring.stringify(params)
    return http.requestGet(apiUrl+"/cms/template/list/"+page+"/"+size+"?"+string);
  },
  template_add(params) {
    return http.requestPost(apiUrl+"/cms/template/add",params);
  },
  //新增页面
  page_add(params) {
    return http.requestPost(apiUrl+"/cms/page/add",params);
  },
  //获得页面信息
  page_get(id) {
    return http.requestQuickGet(apiUrl+'/cms/page/get/'+id);
  },
  //修改页面
  page_edit(id,params) {
    return http.requestPut(apiUrl+'/cms/page/edit/'+id,params);
  },
  //删除页面
  page_delete(id) {
    return http.requestDelete(apiUrl+'/cms/page/del/'+id);
  }
}



